<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Serialization</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Serialization"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Serialization rootpage-Serialization skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Serialization</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">This article is about data structure encoding. For other uses, see <a href="Serialization_(disambiguation)" class="mw-disambig" title="Serialization (disambiguation)">Serialization (disambiguation)</a>.</div>
<style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<p>In computing, <b>serialization</b> (or <b>serialisation</b>, also referred to as <b>pickling</b> in <a href="Python_(programming_language)" title="Python (programming language)">Python</a>) is the process of translating a <a href="Data_structure" title="Data structure">data structure</a> or <a href="Object_(computer_science)" title="Object (computer science)">object</a> state into a format that can be stored (e.g. <a href="Computer_file" title="Computer file">files</a> in <a href="Secondary_storage_devices" class="mw-redirect" title="Secondary storage devices">secondary storage devices</a>, <a href="Data_buffer" title="Data buffer">data buffers</a> in primary storage devices) or transmitted (e.g. <a href="Data_stream" title="Data stream">data streams</a> over <a href="Computer_networks" class="mw-redirect" title="Computer networks">computer networks</a>) and reconstructed later (possibly in a different computer environment).<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of <a href="Reference_(computer_science)" title="Reference (computer science)">references</a>, this process is not straightforward. Serialization of <a href="Object_(computer_science)" title="Object (computer science)">objects</a> does not include any of their associated <a href="Method_(computer_science)" class="mw-redirect" title="Method (computer science)">methods</a> with which they were previously linked.
</p><p>This process of serializing an object is also called <a href="Marshalling_(computer_science)" title="Marshalling (computer science)">marshalling</a> an object in some situations.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-ocaml_3-0" class="reference"><a href="#cite_note-ocaml-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> The opposite operation, extracting a data structure from a series of bytes, is <b>deserialization</b>, (also called <b>unserialization</b> or <b><a href="Unmarshalling" class="mw-redirect" title="Unmarshalling">unmarshalling</a></b>).
</p><p>In networking equipment hardware, the part that is responsible for serialization and deserialization is commonly called <a href="SerDes" title="SerDes">SerDes</a>.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Uses">Uses</h2></div>
<p>Uses of serialization include:
</p>
<ul><li>serializing data for transfer across wires and networks (<a href="Messaging" class="mw-redirect" title="Messaging">messaging</a>).</li>
<li>storing data (in <a href="Database" title="Database">databases</a>, on <a href="Hard_disk_drive" title="Hard disk drive">hard disk drives</a>).</li>
<li><a href="Remote_procedure_call" title="Remote procedure call">remote procedure calls</a>, e.g., as in <a href="SOAP" title="SOAP">SOAP</a>.</li>
<li>distributing objects, especially in <a href="Component-based_software_engineering" title="Component-based software engineering">component-based software engineering</a> such as <a href="Component_Object_Model" title="Component Object Model">COM</a>, <a href="CORBA" class="mw-redirect" title="CORBA">CORBA</a>, etc.</li>
<li>detecting changes in time-varying data.</li></ul>
<p>For some of these features to be useful, architecture independence must be maintained. For example, for maximal use of distribution, a computer running on a different <a href="Hardware_architecture" title="Hardware architecture">hardware architecture</a> should be able to reliably reconstruct a serialized data stream, regardless of <a href="Endianness" title="Endianness">endianness</a>. This means that the simpler and faster procedure of directly copying the memory layout of the data structure cannot work reliably for all architectures. Serializing the data structure in an architecture-independent format means preventing the problems of <a href="Byte_ordering" class="mw-redirect" title="Byte ordering">byte ordering</a>, memory layout, or simply different ways of representing data structures in different <a href="Programming_language" title="Programming language">programming languages</a>.
</p><p>Inherent to any serialization scheme is that, because the encoding of the data is by definition serial, extracting one part of the serialized data structure requires that the entire object be read from start to end, and reconstructed. In many applications, this linearity is an asset, because it enables simple, common I/O interfaces to be utilized to hold and pass on the state of an object. In applications where higher performance is an issue, it can make sense to expend more effort to deal with a more complex, non-linear storage organization.
</p><p>Even on a single machine, primitive <a href="Pointer_(computer_programming)" title="Pointer (computer programming)">pointer</a> objects are too fragile to save because the objects to which they point may be reloaded to a different location in memory. To deal with this, the serialization process includes a step called <i><a href="Unswizzling" class="mw-redirect" title="Unswizzling">unswizzling</a></i> or <i>pointer unswizzling</i>, where direct pointer references are converted to references based on name or position. The deserialization process includes an inverse step called <i><a href="Pointer_swizzling" title="Pointer swizzling">pointer swizzling</a></i>.
</p><p>Since both serializing and deserializing can be driven from common code (for example, the <i>Serialize</i> function in <a href="Microsoft_Foundation_Classes" class="mw-redirect" title="Microsoft Foundation Classes">Microsoft Foundation Classes</a>), it is possible for the common code to do both at the same time, and thus, 1) detect differences between the objects being serialized and their prior copies, and 2) provide the input for the next such detection. It is not necessary to actually build the prior copy because differences can be detected on the fly, a technique called differential execution. This is useful in the programming of user interfaces whose contents are time-varying — graphical objects can be created, removed, altered, or made to handle input events without necessarily having to write separate code to do those things.
</p>
<div class="mw-heading mw-heading2"><h2 id="Drawbacks">Drawbacks</h2></div>
<p>Serialization breaks the opacity of an <a href="Abstract_data_type" title="Abstract data type">abstract data type</a> by potentially exposing private implementation details. Trivial implementations which serialize all data members may violate <a href="Encapsulation_(object-oriented_programming)" class="mw-redirect" title="Encapsulation (object-oriented programming)">encapsulation</a>.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p><p>To discourage competitors from making compatible products, publishers of <a href="Proprietary_software" title="Proprietary software">proprietary software</a> often keep the details of their programs' serialization formats a <a href="Trade_secret" title="Trade secret">trade secret</a>. Some deliberately <a href="Obfuscated_code" class="mw-redirect" title="Obfuscated code">obfuscate</a> or even <a href="Encryption" title="Encryption">encrypt</a> the serialized data. Yet, interoperability requires that applications be able to understand each other's serialization formats. Therefore, <a href="RMI-IIOP" title="RMI-IIOP">remote method call</a> architectures such as <a href="CORBA" class="mw-redirect" title="CORBA">CORBA</a> define their serialization formats in detail.
</p><p>Many institutions, such as archives and libraries, attempt to <a href="Future_proof" class="mw-redirect" title="Future proof">future proof</a> their <a href="Backup" title="Backup">backup</a> archives—in particular, <a href="Database_dump" title="Database dump">database dumps</a>—by storing them in some relatively <a href="Human-readable" class="mw-redirect" title="Human-readable">human-readable</a> serialized format.
</p>
<div class="mw-heading mw-heading2"><h2 id="Serialization_formats">Serialization formats</h2></div>
<div role="note" class="hatnote navigation-not-searchable">Main article: <a href="Comparison_of_data_serialization_formats" class="mw-redirect" title="Comparison of data serialization formats">Comparison of data serialization formats</a></div>
<p>The <a href="Xerox_Network_Systems" title="Xerox Network Systems">Xerox Network Systems</a> Courier technology in the early 1980s influenced the first widely adopted standard. <a href="Sun_Microsystems" title="Sun Microsystems">Sun Microsystems</a> published the <a href="External_Data_Representation" title="External Data Representation">External Data Representation</a> (XDR) in 1987.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> XDR is an <a href="Open_format" class="mw-redirect" title="Open format">open format</a>, and standardized as <a rel="nofollow" class="external text" href="https://tools.ietf.org/html/std67">STD 67</a> (RFC 4506) by <a href="Internet_Standard" title="Internet Standard">IETF</a>.
</p><p>In the late 1990s, a push to provide an alternative to the standard serialization protocols started: <a href="XML" title="XML">XML</a>, an <a href="SGML" class="mw-redirect" title="SGML">SGML</a> subset, was used to produce a human-readable <a href="Binary-to-text_encoding" title="Binary-to-text encoding">text-based encoding</a>. Such an encoding can be useful for persistent objects that may be read and understood by humans or communicated to other systems regardless of programming language. It has the disadvantage of losing the more compact, byte-stream-based encoding, but by this point larger storage and transmission capacities made file size less of a concern than in the early days of computing. In the 2000s, XML was often used for asynchronous transfer of structured data between client and server in <a href="Ajax_(programming)" title="Ajax (programming)">Ajax</a> web applications. XML is an open format and standardized as a W3C recommendation.
</p><p><a href="JSON" title="JSON">JSON</a> is a lightweight plain-text alternative to XML and is also commonly used for client-server communication in web applications. JSON is based on <a href="JavaScript_syntax" title="JavaScript syntax">JavaScript syntax</a> but is independent of JavaScript and supported in many other programming languages. JSON is standardized as <a rel="nofollow" class="external text" href="https://tools.ietf.org/html/std90">STD 90</a> (<style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><a href="RFC_(identifier)" class="mw-redirect" title="RFC (identifier)">RFC</a> <a rel="nofollow" class="external text" href="https://www.rfc-editor.org/rfc/rfc8259">8259</a>), <a rel="nofollow" class="external text" href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf">ECMA-404</a>, and <a rel="nofollow" class="external text" href="https://www.iso.org/standard/71616.html">ISO/IEC 21778:2017</a>.
</p><p><a href="YAML" title="YAML">YAML</a> is a strict superset of JSON and includes additional features such as a data type tags, support for cyclic data structures, indentation-sensitive syntax, and multiple forms of scalar data quoting. YAML is an open format.
</p><p><a href="Property_list" title="Property list">Property lists</a> are used for serialization by <a href="NeXTSTEP" title="NeXTSTEP">NeXTSTEP</a>, <a href="GNUstep" title="GNUstep">GNUstep</a>, <a href="MacOS" title="MacOS">macOS</a>, and <a href="IOS" title="IOS">iOS</a> <a href="Software_framework" title="Software framework">frameworks</a>. <i>Property list</i>, or <i>p-list</i> for short, doesn't refer to a single serialization format but instead several different variants, some human-readable and one binary.
</p><p>For large volume scientific datasets, such as satellite data and output of numerical climate, weather, or ocean models, specific binary serialization standards have been developed, e.g. <a href="Hierarchical_Data_Format" title="Hierarchical Data Format">HDF</a>, <a href="NetCDF" title="NetCDF">netCDF</a> and the older <a href="GRIB" title="GRIB">GRIB</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Programming_language_support">Programming language support</h2></div>
<p>Several <a href="Object-oriented_programming" title="Object-oriented programming">object-oriented programming</a> languages directly support <i>object serialization</i> (or <i>object archival</i>), either by <a href="Syntactic_sugar" title="Syntactic sugar">syntactic sugar</a> elements or providing a standard <a href="Interface_(computing)" title="Interface (computing)">interface</a> for doing so. The languages which do so include <a href="Ruby_programming_language" class="mw-redirect" title="Ruby programming language">Ruby</a>, <a href="Smalltalk" title="Smalltalk">Smalltalk</a>, <a href="Python_(programming_language)" title="Python (programming language)">Python</a>, <a href="PHP" title="PHP">PHP</a>, <a href="Objective-C" title="Objective-C">Objective-C</a>, <a href="Delphi_(programming_language)" class="mw-redirect" title="Delphi (programming language)">Delphi</a>, <a href="Java_(programming_language)" title="Java (programming language)">Java</a>, and the <a href=".NET_Framework" title=".NET Framework">.NET</a> family of languages. There are also libraries available that add serialization support to languages that lack native support for it.
</p>
<div class="mw-heading mw-heading3"><h3 id="C_and_C++">C and C++</h3></div>
<p><a href="C_(programming_language)" title="C (programming language)">C</a> and <a href="C%2B%2B" title="C++">C++</a> do not provide serialization as any sort of high-level construct, but both languages support writing any of the built-in <a href="C_data_types" title="C data types">data types</a>, as well as <a href="Plain_old_data" class="mw-redirect" title="Plain old data">plain old data</a> <a href="Struct_(C_programming_language)" title="Struct (C programming language)">structs</a>, as binary data. As such, it is usually trivial to write custom serialization functions. Moreover, compiler-based solutions, such as the ODB <a href="Object%E2%80%93relational_mapping" title="Object–relational mapping">ORM</a> system for C++ and the <a href="GSOAP" title="GSOAP">gSOAP</a> toolkit for C and C++, are capable of automatically producing serialization code with few or no modifications to class declarations. Other popular serialization frameworks are Boost.Serialization<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> from the <a href="Boost_C%2B%2B_Libraries" class="mw-redirect" title="Boost C++ Libraries">Boost Framework</a>, the S11n framework,<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> and Cereal.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup> <a href="Microsoft_Foundation_Class_Library" title="Microsoft Foundation Class Library">MFC framework</a> (Microsoft) also provides serialization methodology as part of its Document-View architecture.
</p>
<div class="mw-heading mw-heading3"><h3 id="CFML">CFML</h3></div>
<p><a href="CFML" class="mw-redirect" title="CFML">CFML</a> allows data structures to be serialized to <a href="WDDX" title="WDDX">WDDX</a> with the <code><a rel="nofollow" class="external text" href="https://wikidocs.adobe.com/wiki/display/coldfusionen/cfwddx"><cfwddx></a></code> tag and to <a href="JSON" title="JSON">JSON</a> with the <a rel="nofollow" class="external text" href="https://wikidocs.adobe.com/wiki/display/coldfusionen/serializejson">SerializeJSON()</a> function.
</p>
<div class="mw-heading mw-heading3"><h3 id="Delphi">Delphi</h3></div>
<p><a href="Delphi_(programming_language)" class="mw-redirect" title="Delphi (programming language)">Delphi</a> provides a built-in mechanism for serialization of components (also called persistent objects), which is fully integrated with its <a href="Integrated_development_environment" title="Integrated development environment">IDE</a>. The component's contents are saved to a DFM file and reloaded on-the-fly.
</p>
<div class="mw-heading mw-heading3"><h3 id="Go">Go</h3></div>
<p><a href="Go_(programming_language)" title="Go (programming language)">Go</a> natively supports unmarshalling/marshalling of <a href="JSON" title="JSON">JSON</a> and <a href="XML" title="XML">XML</a> data.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> There are also third-party modules that support <a href="YAML" title="YAML">YAML</a><sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> and <a href="Protocol_Buffers" title="Protocol Buffers">Protocol Buffers</a>.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup> Go also supports <i>Gobs</i>.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Haskell">Haskell</h3></div>
<p>In Haskell, serialization is supported for types that are members of the Read and Show <a href="Type_class" title="Type class">type classes</a>. Every type that is a member of the <code>Read</code> type class defines a function that will extract the data from the string representation of the dumped data. The <code>Show</code> type class, in turn, contains the <code>show</code> function from which a string representation of the object can be generated. The programmer need not define the functions explicitly—merely declaring a type to be deriving Read or deriving Show, or both, can make the compiler generate the appropriate functions for many cases (but not all: function types, for example, cannot automatically derive Show or Read). The auto-generated instance for Show also produces valid source code, so the same Haskell value can be generated by running the code produced by show in, for example, a Haskell interpreter.<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup> For more efficient serialization, there are haskell libraries that allow high-speed serialization in binary format, e.g. <a rel="nofollow" class="external text" href="http://hackage.haskell.org/package/binary">binary</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Java">Java</h3></div>
<p>Java provides automatic serialization which requires that the object be <a href="Marker_interface_pattern" title="Marker interface pattern">marked</a> by implementing the <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/io/Serializable.html">java.io.Serializable</a></code> <a href="Interface_(Java)" title="Interface (Java)">interface</a>. Implementing the interface marks the class as "okay to serialize", and Java then handles serialization internally. There are no serialization methods defined on the <code>Serializable</code> interface, but a serializable class can optionally define methods with certain special names and signatures that if defined, will be called as part of the serialization/deserialization process. The language also allows the developer to override the serialization process more thoroughly by implementing another interface, the <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/io/Externalizable.html">Externalizable</a></code> interface, which includes two special methods that are used to save and restore the object's state.<br> There are three primary reasons why objects are not serializable by default and must implement the <code>Serializable</code> interface to access Java's serialization mechanism.<br>Firstly, not all objects capture useful semantics in a serialized state. For example, a <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/Thread.html">Thread</a></code> object is tied to the state of the current <a href="JVM" class="mw-redirect" title="JVM">JVM</a>. There is no context in which a deserialized <code>Thread</code> object would maintain useful semantics.<br>Secondly, the serialized state of an object forms part of its class' compatibility contract. Maintaining compatibility between versions of serializable classes requires additional effort and consideration. Therefore, making a class serializable needs to be a deliberate design decision and not a default condition.<br>Lastly, serialization allows access to non-<a href="Transient_(computer_programming)" title="Transient (computer programming)">transient</a> private members of a class that are not otherwise accessible. Classes containing sensitive information (for example, a password) should not be serializable nor externalizable.<sup id="cite_ref-Bloch_15-0" class="reference"><a href="#cite_note-Bloch-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 339–345">: 339–345 </span></sup> The standard encoding method uses a recursive graph-based translation of the object's class descriptor and serializable fields into a byte stream. <a href="Primitive_data_type" title="Primitive data type">Primitives</a> as well as non-transient, non-static referenced objects are encoded into the stream. Each object that is referenced by the serialized object via a field that is not marked as <code>transient</code> must also be serialized; and if any object in the complete graph of non-transient object references is not serializable, then serialization will fail. The developer can influence this behavior by marking objects as transient, or by redefining the serialization for an object so that some portion of the reference graph is truncated and not serialized.<br> Java does not use constructor to serialize objects. It is possible to serialize Java objects through <a href="JDBC" class="mw-redirect" title="JDBC">JDBC</a> and store them into a database.<sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup> While <a href="Swing_(Java)" title="Swing (Java)">Swing</a> components do implement the Serializable interface, they are not guaranteed to be portable between different versions of the Java Virtual Machine. As such, a Swing component, or any component which inherits it, may be serialized to a byte stream, but it is not guaranteed that this will be re-constitutable on another machine.
</p>
<div class="mw-heading mw-heading3"><h3 id="JavaScript">JavaScript</h3></div>
<p>Since ECMAScript 5.1,<sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup> <a href="JavaScript" title="JavaScript">JavaScript</a> has included the built-in <code>JSON</code> object and its methods <code>JSON.parse()</code> and <code>JSON.stringify()</code>. Although JSON is originally based on a subset of JavaScript,<sup id="cite_ref-18" class="reference"><a href="#cite_note-18"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup> there are boundary cases where JSON is not valid JavaScript. Specifically, JSON allows the <a href="Unicode#Newlines" title="Unicode">Unicode line terminators</a> <span class="nowrap"><style data-mw-deduplicate="TemplateStyles:r886049734">
/* start https://en.wikipedia.org/ */
.mw-parser-output .monospaced{font-family:monospace,monospace}
/* end https://en.wikipedia.org/ */
</style><span class="monospaced">U+2028</span> </span> <span style="font-variant: small-caps; text-transform: lowercase; font-feature-settings: 'onum'">LINE SEPARATOR</span> and <span class="nowrap"><span class="monospaced">U+2029</span> </span> <span style="font-variant: small-caps; text-transform: lowercase; font-feature-settings: 'onum'">PARAGRAPH SEPARATOR</span> to appear unescaped in quoted strings, while ECMAScript 2018 and older does not.<sup id="cite_ref-json-2028_19-0" class="reference"><a href="#cite_note-json-2028-19"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup> See <a href="JSON#Data_portability_issues" title="JSON">the main article on JSON</a>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Julia">Julia</h3></div>
<p><a href="Julia_(programming_language)" title="Julia (programming language)">Julia</a> implements serialization through the <code>serialize()</code> / <code>deserialize()</code> modules,<sup id="cite_ref-21" class="reference"><a href="#cite_note-21"><span class="cite-bracket">[</span>21<span class="cite-bracket">]</span></a></sup> intended to work within the same version of Julia, and/or instance of the same system image.<sup id="cite_ref-22" class="reference"><a href="#cite_note-22"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup> The <code>HDF5.jl</code> package offers a more stable alternative, using a documented format and common library with wrappers for different languages,<sup id="cite_ref-23" class="reference"><a href="#cite_note-23"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup> while the default serialization format is suggested to have been designed rather with maximal performance for network communication in mind.<sup id="cite_ref-24" class="reference"><a href="#cite_note-24"><span class="cite-bracket">[</span>24<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Lisp">Lisp</h3></div>
<p>Generally a <a href="Lisp_(programming_language)" title="Lisp (programming language)">Lisp</a> data structure can be serialized with the functions "<code>read</code>" and "<code>print</code>". A variable foo containing, for example, a list of arrays would be printed by <code>(print foo)</code>. Similarly an object can be read from a stream named s by <code>(read s)</code>. These two parts of the Lisp implementation are called the Printer and the Reader. The output of "<code>print</code>" is human readable; it uses lists demarked by parentheses, for example: <code class="mw-highlight mw-highlight-lang-lisp mw-content-ltr" style="" dir="ltr"><span class="p">(</span><span class="mi">4</span><span class="w"> </span><span class="mf">2.9</span><span class="w"> </span><span class="s">"x"</span><span class="w"> </span><span class="nv">y</span><span class="p">)</span></code>. In many types of Lisp, including <a href="Common_Lisp" title="Common Lisp">Common Lisp</a>, the printer cannot represent every type of data because it is not clear how to do so. In Common Lisp for example the printer cannot print CLOS objects. Instead the programmer may write a method on the generic function <code>print-object</code>, this will be invoked when the object is printed. This is somewhat similar to the method used in Ruby. Lisp code itself is written in the syntax of the reader, called read syntax. Most languages use separate and different parsers to deal with code and data, Lisp only uses one. A file containing lisp code may be read into memory as a data structure, transformed by another program, then possibly executed or written out, such as in a <a href="Read%E2%80%93eval%E2%80%93print_loop" title="Read–eval–print loop">read–eval–print loop</a>. Not all readers/writers support cyclic, recursive or shared structures.
</p>
<div class="mw-heading mw-heading3"><h3 id=".NET">.NET</h3></div>
<p><a href=".NET" title=".NET">.NET</a> has several serializers designed by <a href="Microsoft" title="Microsoft">Microsoft</a>. There are also many serializers by third parties. More than a dozen serializers are discussed and tested <a rel="nofollow" class="external text" href="http://geekswithblogs.net/LeonidGaneline/archive/2015/05/06/serializers-in-.net.-v.2.aspx">here</a>.<sup id="cite_ref-25" class="reference"><a href="#cite_note-25"><span class="cite-bracket">[</span>25<span class="cite-bracket">]</span></a></sup> and <a rel="nofollow" class="external text" href="https://aumcode.github.io/serbench">here</a><sup id="cite_ref-26" class="reference"><a href="#cite_note-26"><span class="cite-bracket">[</span>26<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="OCaml">OCaml</h3></div>
<p><a href="OCaml" title="OCaml">OCaml</a>'s standard library provides marshalling through the <code>Marshal</code> module<sup id="cite_ref-ocaml_3-1" class="reference"><a href="#cite_note-ocaml-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> and the Pervasives functions <code>output_value</code> and <code>input_value</code>. While OCaml programming is statically type-checked, uses of the <code>Marshal</code> module may break type guarantees, as there is no way to check whether an unmarshalled stream represents objects of the expected type. In OCaml it is difficult to marshal a function or a data structure which contains a function (e.g. an object which contains a method), because executable code in functions cannot be transmitted across different programs. (There is a flag to marshal the code position of a function but it can only be unmarshalled in exactly the same program). The standard marshalling functions can preserve sharing and handle cyclic data, which can be configured by a flag.
</p>
<div class="mw-heading mw-heading3"><h3 id="Perl">Perl</h3></div>
<p>Several <a href="Perl" title="Perl">Perl</a> modules available from <a href="CPAN" title="CPAN">CPAN</a> provide serialization mechanisms, including <code>Storable</code> , <code>JSON::XS</code> and <code>FreezeThaw</code>. Storable includes functions to serialize and deserialize Perl data structures to and from files or Perl scalars. In addition to serializing directly to files, <code>Storable</code> includes the <code>freeze</code> function to return a serialized copy of the data packed into a scalar, and <code>thaw</code> to deserialize such a scalar. This is useful for sending a complex data structure over a <a href="Network_socket" title="Network socket">network socket</a> or storing it in a database. When serializing structures with <code>Storable</code>, there are network safe functions that always store their data in a format that is readable on any computer at a small cost of speed. These functions are named <code>nstore</code>, <code>nfreeze</code>, etc. There are no "n" functions for deserializing these structures — the regular <code>thaw</code> and <code>retrieve</code> deserialize structures serialized with the "<code>n</code>" functions and their machine-specific equivalents.
</p>
<div class="mw-heading mw-heading3"><h3 id="PHP">PHP</h3></div>
<p><a href="PHP" title="PHP">PHP</a> originally implemented serialization through the built-in <code>serialize()</code> and <code>unserialize()</code> functions.<sup id="cite_ref-27" class="reference"><a href="#cite_note-27"><span class="cite-bracket">[</span>27<span class="cite-bracket">]</span></a></sup> PHP can serialize any of its data types except resources (file pointers, sockets, etc.). The built-in <code>unserialize()</code> function is often dangerous when used on completely untrusted data.<sup id="cite_ref-28" class="reference"><a href="#cite_note-28"><span class="cite-bracket">[</span>28<span class="cite-bracket">]</span></a></sup> For objects, there are two "<a href="Magic_(programming)" title="Magic (programming)">magic</a> methods" that can be implemented within a class — <code>__sleep()</code> and <code>__wakeup()</code> — that are called from within <code>serialize()</code> and <code>unserialize()</code>, respectively, that can clean up and restore an object. For example, it may be desirable to close a database connection on serialization and restore the connection on deserialization; this functionality would be handled in these two magic methods. They also permit the object to pick which properties are serialized. Since PHP 5.1, there is an object-oriented serialization mechanism for objects, the <code>Serializable</code> interface.<sup id="cite_ref-Serializable_29-0" class="reference"><a href="#cite_note-Serializable-29"><span class="cite-bracket">[</span>29<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Prolog">Prolog</h3></div>
<p><a href="Prolog" title="Prolog">Prolog</a>'s <i>term</i> structure, which is the only data structure of the language, can be serialized out through the built-in predicate <code>write_term/3</code> and serialized-in through the built-in predicates <code>read/1</code> and <code>read_term/2</code>. The resulting stream is uncompressed text (in some encoding determined by configuration of the target stream), with any free variables in the term represented by placeholder variable names. The predicate <code>write_term/3</code> is standardized in the <a href="Prolog#ISO_Prolog" title="Prolog">ISO Specification for Prolog</a> (ISO/IEC 13211-1) on pages 59 ff. ("Writing a term, § 7.10.5"). Therefore it is expected that terms serialized-out by one implementation can be serialized-in by another without ambiguity or surprises. In practice, implementation-specific extensions (e.g. SWI-Prolog's dictionaries) may use non-standard term structures, so interoperability may break in edge cases. As examples, see the corresponding manual pages for SWI-Prolog,<sup id="cite_ref-30" class="reference"><a href="#cite_note-30"><span class="cite-bracket">[</span>30<span class="cite-bracket">]</span></a></sup> SICStus Prolog,<sup id="cite_ref-31" class="reference"><a href="#cite_note-31"><span class="cite-bracket">[</span>31<span class="cite-bracket">]</span></a></sup> GNU Prolog.<sup id="cite_ref-32" class="reference"><a href="#cite_note-32"><span class="cite-bracket">[</span>32<span class="cite-bracket">]</span></a></sup> Whether and how serialized terms received over the network are checked against a specification (after deserialization from the character stream has happened) is left to the implementer. Prolog's built-in <a href="Prolog_syntax_and_semantics#Definite_clause_grammars" title="Prolog syntax and semantics">Definite Clause Grammars</a> can be applied at that stage.
</p>
<div class="mw-heading mw-heading3"><h3 id="Python">Python</h3></div>
<p>The core general serialization mechanism is the <code>pickle</code> <a href="Python_(programming_language)#Libraries" title="Python (programming language)">standard library</a> module, alluding to the database systems term <i>pickling</i><sup id="cite_ref-33" class="reference"><a href="#cite_note-33"><span class="cite-bracket">[</span>33<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-34" class="reference"><a href="#cite_note-34"><span class="cite-bracket">[</span>34<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-35" class="reference"><a href="#cite_note-35"><span class="cite-bracket">[</span>35<span class="cite-bracket">]</span></a></sup> to describe data serialization (<i>unpickling</i> for <i>deserializing</i>). Pickle uses a simple <a href="Stack_(abstract_data_type)" title="Stack (abstract data type)">stack</a>-based <a href="Virtual_machine" title="Virtual machine">virtual machine</a> that records the instructions used to reconstruct the object. It is a cross-version <a rel="nofollow" class="external text" href="https://docs.python.org/library/pickle.html#pickle-protocol">customisable</a> but unsafe (not secure against erroneous or malicious data) serialization format. Malformed or maliciously constructed data, may cause the deserializer to import arbitrary modules and instantiate any object.<sup id="cite_ref-autogenerated1_36-0" class="reference"><a href="#cite_note-autogenerated1-36"><span class="cite-bracket">[</span>36<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-37" class="reference"><a href="#cite_note-37"><span class="cite-bracket">[</span>37<span class="cite-bracket">]</span></a></sup> The standard library also includes modules serializing to standard data formats: <code><a rel="nofollow" class="external text" href="https://docs.python.org/library/json.html">json</a></code> (with built-in support for basic scalar and collection types and able to support arbitrary types via <a rel="nofollow" class="external text" href="https://docs.python.org/library/json.html#encoders-and-decoders">encoding and decoding hooks</a>). <code><a rel="nofollow" class="external text" href="https://docs.python.org/library/plistlib.html">plistlib</a></code> (with support for both binary and XML <a href="Property_list" title="Property list">property list</a> formats). <code><a rel="nofollow" class="external text" href="https://docs.python.org/library/xdrlib.html">xdrlib</a></code> (with support for the External Data Representation (XDR) standard as described in RFC 1014). Finally, it is recommended that an object's <code><a rel="nofollow" class="external text" href="https://docs.python.org/reference/datamodel.html#object.__repr__">__repr__</a></code> be evaluable in the right environment, making it a rough match for Common Lisp's <code><a rel="nofollow" class="external text" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_pr_obj.htm">print-object</a></code>. Not all object types can be pickled automatically, especially ones that hold <a href="Operating_system" title="Operating system">operating system</a> resources like <a href="File_handle" class="mw-redirect" title="File handle">file handles</a>, but users can register custom "reduction" and construction functions to support the pickling and unpickling of arbitrary types. Pickle was originally implemented as the pure Python <code>pickle</code> module, but, in versions of Python prior to 3.0, the <code>cPickle</code> module (also a built-in) offers improved performance (up to 1000 times faster<sup id="cite_ref-autogenerated1_36-1" class="reference"><a href="#cite_note-autogenerated1-36"><span class="cite-bracket">[</span>36<span class="cite-bracket">]</span></a></sup>). The <code>cPickle</code> was adapted from the <a href="Unladen_Swallow" title="Unladen Swallow">Unladen Swallow</a> project. In Python 3, users should always import the standard version, which attempts to import the accelerated version and falls back to the pure Python version.<sup id="cite_ref-38" class="reference"><a href="#cite_note-38"><span class="cite-bracket">[</span>38<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="R">R</h3></div>
<p><a href="R_(programming_language)" title="R (programming language)">R</a> has the function <code>dput</code> which writes an ASCII text representation of an R object to a file or connection. A representation can be read from a file using <code>dget</code>.<sup id="cite_ref-39" class="reference"><a href="#cite_note-39"><span class="cite-bracket">[</span>39<span class="cite-bracket">]</span></a></sup> More specific, the function <code>serialize</code> serializes an R object to a connection, the output being a raw vector coded in hexadecimal format. The <code>unserialize</code> function allows to read an object from a connection or a raw vector.<sup id="cite_ref-40" class="reference"><a href="#cite_note-40"><span class="cite-bracket">[</span>40<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="REBOL">REBOL</h3></div>
<p><a href="REBOL" class="mw-redirect" title="REBOL">REBOL</a> will serialize to file (<code>save/all</code>) or to a <code>string!</code> (<code>mold/all</code>). Strings and files can be deserialized using the <a href="Type_polymorphism" class="mw-redirect" title="Type polymorphism">polymorphic</a> <code>load</code> function. <code>RProtoBuf</code> provides cross-language data serialization in R, using <a href="Protocol_Buffers" title="Protocol Buffers">Protocol Buffers</a>.<sup id="cite_ref-41" class="reference"><a href="#cite_note-41"><span class="cite-bracket">[</span>41<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Ruby">Ruby</h3></div>
<p><a href="Ruby_programming_language" class="mw-redirect" title="Ruby programming language">Ruby</a> includes the standard module <code><a rel="nofollow" class="external text" href="https://docs.ruby-lang.org/en/master/Marshal.html">Marshal</a></code> with 2 methods <code>dump</code> and <code>load</code>, akin to the standard Unix utilities <code><a href="Dump_(Unix)" title="Dump (Unix)">dump</a></code> and <code>restore</code>. These methods serialize to the standard class <code>String</code>, that is, they effectively become a sequence of bytes. Some objects cannot be serialized (doing so would raise a <code>TypeError</code> exception): bindings, procedure objects, instances of class IO, singleton objects and interfaces. If a class requires custom serialization (for example, it requires certain cleanup actions done on dumping / restoring), it can be done by implementing 2 methods: <code>_dump</code> and <code>_load</code>. The <a href="Instance_method" class="mw-redirect" title="Instance method">instance method</a> <code>_dump</code> should return a <code>String</code> object containing all the information necessary to reconstitute objects of this class and all referenced objects up to a maximum depth given as an integer parameter (a value of -1 implies that depth checking should be disabled). The <a href="Class_method" class="mw-redirect" title="Class method">class method</a> <code>_load</code> should take a <code>String</code> and return an object of this class.
</p>
<div class="mw-heading mw-heading3"><h3 id="Rust">Rust</h3></div>
<p><code><a rel="nofollow" class="external text" href="https://serde.rs/">Serde</a></code> is the most widely used library, or crate, for serialization in <a href="Rust_programming_language" class="mw-redirect" title="Rust programming language">Rust</a> which provides the <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">Serialize</code> and <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">Deserialize</code> traits.
</p>
<div class="mw-heading mw-heading3"><h3 id="Smalltalk">Smalltalk</h3></div>
<p>In general, non-recursive and non-sharing objects can be stored and retrieved in a human readable form using the <code>storeOn:</code>/<code>readFrom:</code> protocol. The <code>storeOn:</code> method generates the text of a Smalltalk expression which – when evaluated using <code>readFrom:</code> – recreates the original object. This scheme is special, in that it uses a procedural description of the object, not the data itself. It is therefore very flexible, allowing for classes to define more compact representations. However, in its original form, it does not handle cyclic data structures or preserve the identity of shared references (i.e. two references a single object will be restored as references to two equal, but not identical copies). For this, various portable and non-portable alternatives exist. Some of them are specific to a particular Smalltalk implementation or class library. There are several ways in <a href="Squeak" title="Squeak">Squeak Smalltalk</a> to serialize and store objects. The easiest and most used are <code>storeOn:/readFrom:</code> and binary storage formats based on <code>SmartRefStream</code> serializers. In addition, bundled objects can be stored and retrieved using <code>ImageSegments</code>. Both provide a so-called "binary-object storage framework", which support serialization into and retrieval from a compact binary form. Both handle cyclic, recursive and shared structures, storage/retrieval of class and <a href="Metaclass" title="Metaclass">metaclass</a> info and include mechanisms for "on the fly" object migration (i.e. to convert instances which were written by an older version of a class with a different object layout). The APIs are similar (storeBinary/readBinary), but the encoding details are different, making these two formats incompatible. However, the Smalltalk/X code is open source and free and can be loaded into other Smalltalks to allow for cross-dialect object interchange. Object serialization is not part of the ANSI Smalltalk specification. As a result, the code to serialize an object varies by Smalltalk implementation. The resulting binary data also varies. For instance, a serialized object created in Squeak Smalltalk cannot be restored in Ambrai Smalltalk. Consequently, various applications that do work on multiple Smalltalk implementations that rely on object serialization cannot share data between these different implementations. These applications include the MinneStore object database<sup id="cite_ref-42" class="reference"><a href="#cite_note-42"><span class="cite-bracket">[</span>42<span class="cite-bracket">]</span></a></sup> and some <a href="Remote_procedure_call" title="Remote procedure call">RPC</a> packages. A solution to this problem is SIXX,<sup id="cite_ref-43" class="reference"><a href="#cite_note-43"><span class="cite-bracket">[</span>43<span class="cite-bracket">]</span></a></sup> which is a package for multiple Smalltalks that uses an <a href="XML" title="XML">XML</a>-based format for serialization.
</p>
<div class="mw-heading mw-heading3"><h3 id="Swift">Swift</h3></div>
<p>The <a href="Swift_(programming_language)" title="Swift (programming language)">Swift</a> standard library provides two protocols, <code>Encodable</code> and <code>Decodable</code> (composed together as <code>Codable</code>), which allow instances of conforming types to be serialized to or deserialized from <a href="JSON" title="JSON">JSON</a>, <a href="Property_list" title="Property list">property lists</a>, or other formats.<sup id="cite_ref-44" class="reference"><a href="#cite_note-44"><span class="cite-bracket">[</span>44<span class="cite-bracket">]</span></a></sup> Default implementations of these protocols can be generated by the compiler for types whose stored properties are also <code>Decodable</code> or <code>Encodable</code>.
</p>
<div class="mw-heading mw-heading3"><h3 id="PowerShell">PowerShell</h3></div>
<p><a href="PowerShell" title="PowerShell">PowerShell</a> implements serialization through the <a href="Shell_builtin" title="Shell builtin">built-in</a> cmdlet <code>Export-CliXML</code>. <code>Export-CliXML</code> serializes .NET objects and stores the resulting XML in a file. To reconstitute the objects, use the <code>Import-CliXML</code> cmdlet, which generates a deserialized object from the XML in the exported file. Deserialized objects, often known as "property bags" are not live objects; they are snapshots that have properties, but no methods. Two dimensional data structures can also be (de)serialized in <a href="Comma-separated_values" title="Comma-separated values">CSV</a> format using the built-in cmdlets <code>Import-CSV</code> and <code>Export-CSV</code>.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Commutation_(telemetry)" title="Commutation (telemetry)">Commutation (telemetry)</a></li>
<li><a href="Comparison_of_data_serialization_formats" class="mw-redirect" title="Comparison of data serialization formats">Comparison of data serialization formats</a></li>
<li><a href="Container_format" title="Container format">Container format</a></li>
<li><a href="Hibernate_(Java)" class="mw-redirect" title="Hibernate (Java)">Hibernate (Java)</a></li>
<li><a href="XML_Schema_(W3C)" title="XML Schema (W3C)">XML Schema</a></li>
<li><a href="Basic_Encoding_Rules" class="mw-redirect" title="Basic Encoding Rules">Basic Encoding Rules</a></li>
<li><a href="Google_Protocol_Buffers" class="mw-redirect" title="Google Protocol Buffers">Google Protocol Buffers</a></li>
<li><a href="Wikidata" title="Wikidata">Wikibase</a></li>
<li><a href="Apache_Avro" title="Apache Avro">Apache Avro</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist reflist-columns references-column-width" style="column-width: 30em;">
<ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><cite id="CITEREFCline" class="citation web cs1">Cline, Marshall. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20150405013606/http://isocpp.org/wiki/faq/serialization">"C++ FAQ: "What's This "Serialization" Thing All About?""</a>. Archived from <a rel="nofollow" class="external text" href="http://www.parashift.com/c++-faq-lite/serialize-overview.html">the original</a> on 2015-04-05. <q>It lets you take an object or group of objects, put them on a disk or send them through a wire or wireless transport mechanism, then later, perhaps on another computer, reverse the process, resurrecting the original object(s). The basic mechanisms are to flatten object(s) into a one-dimensional stream of bits, and to turn that stream of bits back into the original object(s).</q></cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.ruby-lang.org/en/master/Marshal.html">"Module: Marshal (Ruby 3.0.2)"</a>. <i>ruby-doc.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">25 July</span> 2021</span>.</cite></span>
</li>
<li id="cite_note-ocaml-3"><span class="mw-cite-backlink">^ <a href="#cite_ref-ocaml_3-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-ocaml_3-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://ocaml.org/api/Marshal.html">"Marshal"</a>. <i>OCaml</i><span class="reference-accessdate">. Retrieved <span class="nowrap">25 July</span> 2021</span>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.python.org/3/library/pickle.html?highlight=marshalling#module-pickle">"Python 3.9.6 documentation - Python object serialization —pickle"</a>. <i>Documentation - The Python Standard Library</i>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFS._Miller" class="citation web cs1">S. Miller, Mark. <a rel="nofollow" class="external text" href="http://erights.org/data/serial/jhu-paper/intro.html">"Safe Serialization Under Mutual Suspicion"</a>. <i>ERights.org</i>. <q>Serialization, explained below, is an example of a tool for use by objects within an object system for operating on the graph they are embedded in. This seems to require violating the encapsulation provided by the pure object model.</q></cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFSun_Microsystems1987" class="citation journal cs1">Sun Microsystems (1987). <a rel="nofollow" class="external text" href="http://tools.ietf.org/html/rfc1014">"XDR: External Data Representation Standard"</a>. <i>RFC 1014</i>. Network Working Group<span class="reference-accessdate">. Retrieved <span class="nowrap">July 11,</span> 2011</span>.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.boost.org/doc/libs/1_46_1/libs/serialization/doc/index.html">"Serialization"</a>. <i>www.boost.org</i>.</cite></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite id="CITEREFbeal" class="citation web cs1">beal, stephan. <a rel="nofollow" class="external text" href="http://s11n.net/">"s11n.net: object serialization/persistence in C++"</a>. <i>s11n.net</i>.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://uscilab.github.io/cereal/">"cereal Docs - Main"</a>. <i>uscilab.github.io</i>.</cite></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://pkg.go.dev/encoding">"Package encoding"</a>. <i>pkg.go.dev</i>. 12 July 2021.</cite></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://github.com/go-yaml/yaml">"GitHub - YAML support for the Go language"</a>. <i>GitHub</i><span class="reference-accessdate">. Retrieved <span class="nowrap">25 July</span> 2021</span>.</cite></span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://pkg.go.dev/google.golang.org/protobuf/proto">"proto · pkg.go.dev"</a>. <i>pkg.go.dev</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2021-06-22</span></span>.</cite></span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://pkg.go.dev/encoding/gob">"gob package - encoding/gob - pkg.go.dev"</a>. <i>pkg.go.dev</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2022-03-04</span></span>.</cite></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://hackage.haskell.org/package/base-4.6.0.1/docs/Text-Show.html#t:Show">"Text.Show Documentation"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">15 January</span> 2014</span>.</cite></span>
</li>
<li id="cite_note-Bloch-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-Bloch_15-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFBloch2018" class="citation book cs1">Bloch, Joshua (2018). <i>"Effective Java: Programming Language Guide"</i> (third ed.). Addison-Wesley. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-0134685991</bdi>.</cite></span>
</li>
<li id="cite_note-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-16">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://asktom.oracle.com/pls/apex/f?p=100:11:0::::p11_question_id:1285601748584">"Ask TOM "Serializing Java Objects into the database (and ge...""</a>. <i>asktom.oracle.com</i>.</cite></span>
</li>
<li id="cite_note-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-17">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON#Specifications">"JSON"</a>. <i>MDN Web Docs</i><span class="reference-accessdate">. Retrieved <span class="nowrap">22 March</span> 2018</span>.</cite></span>
</li>
<li id="cite_note-18"><span class="mw-cite-backlink"><b><a href="#cite_ref-18">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.json.org/">"JSON"</a>. <i>www.json.org</i><span class="reference-accessdate">. Retrieved <span class="nowrap">22 March</span> 2018</span>.</cite></span>
</li>
<li id="cite_note-json-2028-19"><span class="mw-cite-backlink"><b><a href="#cite_ref-json-2028_19-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFHolm,_Magnus2011" class="citation web cs1">Holm, Magnus (15 May 2011). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20120513012409/http://timelessrepo.com/json-isnt-a-javascript-subset">"JSON: The JavaScript subset that isn't"</a>. The timeless repository. Archived from <a rel="nofollow" class="external text" href="http://timelessrepo.com/json-isnt-a-javascript-subset">the original</a> on 13 May 2012<span class="reference-accessdate">. Retrieved <span class="nowrap">23 September</span> 2016</span>.</cite></span>
</li>
<li id="cite_note-20"><span class="mw-cite-backlink"><b><a href="#cite_ref-20">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://tc39.github.io/proposal-json-superset/">"TC39 Proposal: Subsume JSON"</a>. ECMA TC39 committee. 22 May 2018.</cite></span>
</li>
<li id="cite_note-21"><span class="mw-cite-backlink"><b><a href="#cite_ref-21">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.julialang.org/en/v1/stdlib/Serialization/">"Serialization"</a>. <i>The Julia Language</i><span class="reference-accessdate">. Retrieved <span class="nowrap">25 July</span> 2021</span>.</cite></span>
</li>
<li id="cite_note-22"><span class="mw-cite-backlink"><b><a href="#cite_ref-22">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://github.com/JuliaLang/julia/commit/bb67ff25e2799b27d10877692f74bae66ccc0270#commitcomment-6403498">"faster and more compact serialization of symbols and strings · JuliaLang/julia@bb67ff2"</a>. <i>GitHub</i>.</cite></span>
</li>
<li id="cite_note-23"><span class="mw-cite-backlink"><b><a href="#cite_ref-23">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://github.com/JuliaIO/HDF5.jl">"HDF5.jl: Saving and loading data in the HDF5 file format"</a>. 20 August 2017 – via GitHub.</cite></span>
</li>
<li id="cite_note-24"><span class="mw-cite-backlink"><b><a href="#cite_ref-24">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://stackoverflow.com/a/24968971/2668831">"Julia: how stable are serialize() / deserialize()"</a>. <i>stackoverflow.com</i>. 2014.</cite></span>
</li>
<li id="cite_note-25"><span class="mw-cite-backlink"><b><a href="#cite_ref-25">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://geekswithblogs.net/LeonidGaneline/archive/2015/05/06/serializers-in-.net.-v.2.aspx">".NET Serializers"</a>. <q>There are many kinds of serializers; they produce very compact data very fast. There are serializers for messaging, for data stores, for marshaling objects. What is the best serializer in .NET?</q></cite></span>
</li>
<li id="cite_note-26"><span class="mw-cite-backlink"><b><a href="#cite_ref-26">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://aumcode.github.io/serbench">"SERBENCH by aumcode"</a>. <i>aumcode.github.io</i>.</cite></span>
</li>
<li id="cite_note-27"><span class="mw-cite-backlink"><b><a href="#cite_ref-27">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://ca.php.net/manual/en/language.oop5.serialization.php">"PHP: Object Serialization - Manual"</a>. <i>ca.php.net</i>.</cite></span>
</li>
<li id="cite_note-28"><span class="mw-cite-backlink"><b><a href="#cite_ref-28">^</a></b></span> <span class="reference-text"><cite id="CITEREFEsser2009" class="citation web cs1">Esser, Stephen (2009-11-28). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20120106034257/http://www.suspekt.org/2009/11/28/shocking-news-in-php-exploitation/">"Shocking News in PHP Exploitation"</a>. <i>Suspekt..</i>. Archived from <a rel="nofollow" class="external text" href="http://www.suspekt.org/2009/11/28/shocking-news-in-php-exploitation/">the original</a> on 2012-01-06.</cite></span>
</li>
<li id="cite_note-Serializable-29"><span class="mw-cite-backlink"><b><a href="#cite_ref-Serializable_29-0">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.php.net/manual/en/class.serializable.php">"PHP: Serializable - Manual"</a>. <i>www.php.net</i>.</cite></span>
</li>
<li id="cite_note-30"><span class="mw-cite-backlink"><b><a href="#cite_ref-30">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.swi-prolog.org/pldoc/man?section=termrw">""Term reading and writing""</a>. <i>www.swi-prolog.org</i>.</cite></span>
</li>
<li id="cite_note-31"><span class="mw-cite-backlink"><b><a href="#cite_ref-31">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://sicstus.sics.se/sicstus/docs/latest4/html/sicstus.html/mpg_002dref_002dwrite_005fterm.html#mpg_002dref_002dwrite_005fterm">""write_term/[2,3]""</a>. <i>sicstus.sics.se</i>.</cite></span>
</li>
<li id="cite_note-32"><span class="mw-cite-backlink"><b><a href="#cite_ref-32">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://gprolog.org/manual/html_node/gprolog038.html">""Term input/output""</a>. <i>gprolog.org</i>.</cite></span>
</li>
<li id="cite_note-33"><span class="mw-cite-backlink"><b><a href="#cite_ref-33">^</a></b></span> <span class="reference-text"><cite id="CITEREFHerlihyLiskov1982" class="citation journal cs1"><a href="Maurice_Herlihy" title="Maurice Herlihy">Herlihy, Maurice</a>; <a href="Barbara_Liskov" title="Barbara Liskov">Liskov, Barbara</a> (October 1982). <a rel="nofollow" class="external text" href="http://cs.brown.edu/~mph/HerlihyL82/p527-herlihy.pdf">"A Value Transmission Method for Abstract Data Types"</a> <span class="cs1-format">(PDF)</span>. <i><a href="ACM_Transactions_on_Programming_Languages_and_Systems" title="ACM Transactions on Programming Languages and Systems">ACM Transactions on Programming Languages and Systems</a></i>. <b>4</b> (4): <span class="nowrap">527–</span>551. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.87.5301">10.1.1.87.5301</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F69622.357182">10.1145/69622.357182</a>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0164-0925">0164-0925</a>. <a href="OCLC_(identifier)" class="mw-redirect" title="OCLC (identifier)">OCLC</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/oclc/67989840">67989840</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:8126961">8126961</a>.</cite></span>
</li>
<li id="cite_note-34"><span class="mw-cite-backlink"><b><a href="#cite_ref-34">^</a></b></span> <span class="reference-text"><cite id="CITEREFBirrellJonesWobber1987" class="citation book cs1">Birrell, Andrew; Jones, Mike; Wobber, Ted (November 1987). "A simple and efficient implementation of a small database". <i>Proceedings of the eleventh ACM Symposium on Operating systems principles - SOSP '87</i>. Vol. 11. pp. <span class="nowrap">149–</span>154. <a href="CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.100.1457">10.1.1.100.1457</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F41457.37517">10.1145/41457.37517</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>089791242X</bdi>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0163-5980">0163-5980</a>. <a href="OCLC_(identifier)" class="mw-redirect" title="OCLC (identifier)">OCLC</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/oclc/476062921">476062921</a>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:12908261">12908261</a>. <q>Our implementation makes use of a mechanism called "pickles", which will convert between any strongly typed data structure and a representation of that structure suitable for storing in permanent disk files. The operation Pickle.Write takes a pointer to a strongly typed data structure and delivers buffers of bits for writing to the disk. Conversely Pickle.Read reads buffers of bits from the disk and delivers a copy of the original data structure.(*) This conversion involves identifying the occurrences of addresses in the structure, and arranging that when the structure is read back from disk the addresses are replaced with addresses valid in the current execution environment. The pickle mechanism is entirely automatic: it is driven by the run-time typing structures that are present for our garbage collection mechanism. ... (*) Pickling is quite similar to the concept of marshalling in remote procedure calls. But in fact our pickling implementation works only by interpreting at run-time the structure of <a href="Dynamically_typed" class="mw-redirect" title="Dynamically typed">dynamically typed</a> values, while our RPC implementation works only by generating code for the marshalling of statically typed values. Each facility would benefit from adding the mechanisms of the other, but that has not yet been done.</q></cite></span>
</li>
<li id="cite_note-35"><span class="mw-cite-backlink"><b><a href="#cite_ref-35">^</a></b></span> <span class="reference-text"><cite id="CITEREFvan_Rossum1994" class="citation web cs1"><a href="Guido_van_Rossum" title="Guido van Rossum">van Rossum, Guido</a> (1 December 1994). <a rel="nofollow" class="external text" href="http://legacy.python.org/workshops/1994-11/FlattenPython.html">"Flattening Python Objects"</a>. <i>Python Programming Language – Legacy Website</i>. <a href="Delaware" title="Delaware">Delaware</a>, United States: <a href="Python_Software_Foundation" title="Python Software Foundation">Python Software Foundation</a><span class="reference-accessdate">. Retrieved <span class="nowrap">6 April</span> 2017</span>. <q>Origin of the name 'flattening': Because I want to leave the original 'marshal' module alone, and Jim complained that 'serialization' also means something totally different that's actually relevant in the context of <a href="Concurrent_computing" title="Concurrent computing">concurrent</a> access to persistent objects, I'll use the term 'flattening' from now on. ... (The Modula-3 system uses the term 'pickled' data for this concept. They have probably solved all problems already, and in a type-safe manner :-)</q></cite></span>
</li>
<li id="cite_note-autogenerated1-36"><span class="mw-cite-backlink">^ <a href="#cite_ref-autogenerated1_36-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-autogenerated1_36-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.python.org/2/library/pickle.html">"11.1. pickle — Python object serialization — Python 2.7.14rc1 documentation"</a>. <i>docs.python.org</i>.</cite></span>
</li>
<li id="cite_note-37"><span class="mw-cite-backlink"><b><a href="#cite_ref-37">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.python.org/release/3.0.1/library/pickle.html#pickle-restrict">"pickle — Python object serialization — Python v3.0.1 documentation"</a>. <i>docs.python.org</i>.</cite></span>
</li>
<li id="cite_note-38"><span class="mw-cite-backlink"><b><a href="#cite_ref-38">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://docs.python.org/release/3.1.5/whatsnew/3.0.html">"What's New In Python 3.0 — Python v3.1.5 documentation"</a>. <i>docs.python.org</i>.</cite></span>
</li>
<li id="cite_note-39"><span class="mw-cite-backlink"><b><a href="#cite_ref-39">^</a></b></span> <span class="reference-text">[R manual <a rel="nofollow" class="external free" href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/dput.html">http://stat.ethz.ch/R-manual/R-patched/library/base/html/dput.html</a>]</span>
</li>
<li id="cite_note-40"><span class="mw-cite-backlink"><b><a href="#cite_ref-40">^</a></b></span> <span class="reference-text">[R manual <a rel="nofollow" class="external free" href="http://stat.ethz.ch/R-manual/R-patched/library/base/html/serialize.html">http://stat.ethz.ch/R-manual/R-patched/library/base/html/serialize.html</a>]</span>
</li>
<li id="cite_note-41"><span class="mw-cite-backlink"><b><a href="#cite_ref-41">^</a></b></span> <span class="reference-text"><cite id="CITEREFEddelbuettelStokelyOoms2014" class="citation journal cs1">Eddelbuettel, Dirk; Stokely, Murray; Ooms, Jeroen (2014). <a rel="nofollow" class="external text" href="https://doi.org/10.18637%2Fjss.v071.i02">"RProtoBuf: Efficient Cross-Language Data Serialization in R"</a>. <i>Journal of Statistical Software</i>. <b>71</b> (2). <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/1401.7372">1401.7372</a></span>. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.18637%2Fjss.v071.i02">10.18637/jss.v071.i02</a></span>. <a href="S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:36239952">36239952</a>.</cite></span>
</li>
<li id="cite_note-42"><span class="mw-cite-backlink"><b><a href="#cite_ref-42">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20080511234145/http://minnestore.sourceforge.net/">"MinneStore version 2"</a>. <i>SourceForge</i>. Archived from <a rel="nofollow" class="external text" href="http://minnestore.sourceforge.net/">the original</a> on 11 May 2008.</cite></span>
</li>
<li id="cite_note-43"><span class="mw-cite-backlink"><b><a href="#cite_ref-43">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.mars.dti.ne.jp/~umejava/smalltalk/sixx/index.html">"What's new"</a>. <i>SIXX - Smalltalk Instance eXchange in XML</i>. 23 January 2010<span class="reference-accessdate">. Retrieved <span class="nowrap">25 July</span> 2021</span>.</cite></span>
</li>
<li id="cite_note-44"><span class="mw-cite-backlink"><b><a href="#cite_ref-44">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://github.com/apple/swift-evolution/blob/master/proposals/0166-swift-archival-serialization.md">"Swift Archival & Serialization"</a>. <i>www.github.com</i>. 2018-12-02.</cite></span>
</li>
</ol></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://docs.oracle.com/javase/8/docs/technotes/guides/serialization">Java Object Serialization documentation</a></li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20070122194723/http://java.sun.com/j2se/1.4.2/docs/guide/serialization/index.html">Java 1.4 Object Serialization documentation</a>.</li>
<li><a rel="nofollow" class="external text" href="http://www.macchiato.com/columns/Durable4.html">Durable Java: Serialization</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20051125013312/http://www.macchiato.com/columns/Durable4.html">Archived</a> 25 November 2005 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></li>
<li><a rel="nofollow" class="external text" href="http://rpbourret.com/xml/XMLDataBinding.htm">XML Data Binding Resources</a></li>
<li><a rel="nofollow" class="external text" href="http://dev.simantics.org/index.php/Org.simantics.databoard">Databoard</a> - Binary serialization with partial and random access, type system, RPC, type adaption, and text format</li></ul>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1236075235">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="Data_exchange_formats144" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div id="Data_exchange_formats144" style="font-size:114%;margin:0 4em"><a href="Data_exchange" title="Data exchange">Data exchange</a> formats</div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Human-readable_medium_and_data" title="Human-readable medium and data">Human<br>readable</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Atom_(web_standard)" title="Atom (web standard)">Atom</a></li>
<li><a href="Comma-separated_values" title="Comma-separated values">CSV</a></li>
<li><a href="EDIFACT" title="EDIFACT">EDIFACT</a></li>
<li><a href="JSON" title="JSON">JSON</a>
<ul><li><a href="JSON_Web_Encryption" title="JSON Web Encryption">Web Encryption</a></li>
<li><a href="JSON_Web_Token" title="JSON Web Token">Web Token</a></li>
<li><a href="JSON_Web_Signature" title="JSON Web Signature">Web Signature</a></li></ul></li>
<li><a href="Property_list" title="Property list">Property list</a></li>
<li><a href="Resource_Description_Framework" title="Resource Description Framework">RDF</a></li>
<li><a href="Rebol" title="Rebol">Rebol</a></li>
<li><a href="TOML" title="TOML">TOML</a></li>
<li><a href="XML" title="XML">XML</a></li>
<li><a href="YAML" title="YAML">YAML</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Binary_file" title="Binary file">Binary</a></th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Action_Message_Format" title="Action Message Format">AMF</a></li>
<li><a href="Ascii85" title="Ascii85">Ascii85</a></li>
<li><a href="ASN.1" title="ASN.1">ASN.1</a>
<ul><li><a href="Structure_of_Management_Information" title="Structure of Management Information">SMI</a></li></ul></li>
<li><a href="Apache_Avro" title="Apache Avro">Avro</a></li>
<li><a href="Base32" title="Base32">Base32</a></li>
<li><a href="Base64" title="Base64">Base64</a></li>
<li><a href="Bencode" title="Bencode">Bencode</a></li>
<li><a href="BSON" title="BSON">BSON</a>
<ul><li><a href="UBJSON" title="UBJSON">UBJSON</a></li></ul></li>
<li><a href="Cap'n_Proto" title="Cap'n Proto">Cap'n Proto</a></li>
<li><a href="CBOR" title="CBOR">CBOR</a></li>
<li><a href="FlatBuffers" title="FlatBuffers">FlatBuffers</a></li>
<li><a href="MessagePack" title="MessagePack">MessagePack</a></li>
<li><a href="Property_list" title="Property list">Property list</a></li>
<li><a href="Protocol_Buffers" title="Protocol Buffers">Protocol Buffers</a></li>
<li><a href="Apache_Thrift" title="Apache Thrift">Thrift</a></li>
<li><a href="Cyphal" title="Cyphal">Cyphal</a> DSDL</li>
<li><a href="External_Data_Representation" title="External Data Representation">XDR</a></li>
<li><a href="Uuencoding" title="Uuencoding">uuencode</a></li>
<li><a href="YEnc" title="YEnc">yEnc</a></li></ul>
</div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div><a href="Comparison_of_data-serialization_formats" title="Comparison of data-serialization formats">Comparison of data-serialization formats</a></div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-04-28" href="https://en.wikipedia.org/wiki/?title=Serialization&oldid=1287755258">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>